package com.woniuxy.dudugua.service.impl;

import com.woniuxy.dudugua.entity.Product;
import com.woniuxy.dudugua.entity.ProductExample;
import com.woniuxy.dudugua.mapper.ProductMapper;
import com.woniuxy.dudugua.service.ProductAllService;
import org.springframework.stereotype.Service;
import com.woniuxy.dudugua.entity.ProductExample.Criteria;

import javax.annotation.Resource;
import java.util.List;
import java.util.Map;

@Service
public class ProductAllServiceImpl implements ProductAllService {
    @Resource
    private ProductMapper productMapper;
    @Override
    public List<Product> selectByAdminProductAll() throws Exception {
        List<Product> productsAll = productMapper.selectByAdminProductAll();
        if(productsAll!=null){
            return  productsAll;
        }
        return null;
    }


    @Override
    public Integer updateByAdminProductStatus(int id) throws Exception {
        Integer updateByAdminProductStatus = productMapper.updateByAdminProductStatus(id);
        if(updateByAdminProductStatus!=0){
            return updateByAdminProductStatus;
        }
        return null;
    }
}
